import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import 'virtual:uno.css'
import { BrowserRouter } from 'react-router-dom'
import { ConfigProvider } from 'antd'
import customTheme from '@/config/theme.ts'
import zhCN from 'antd/locale/zh_CN'
import { px2remTransformer, StyleProvider } from '@ant-design/cssinjs'
const px2rem = px2remTransformer({
  rootValue: 16 // 32px = 1rem; @default 16
})
import 'virtual:svg-icons-register'

ReactDOM.createRoot(document.getElementById('root')!).render(
  <BrowserRouter>
    <StyleProvider transformers={[px2rem]}>
      <ConfigProvider
        locale={zhCN}
        theme={{
          token: {
            colorPrimary: customTheme.primaryColor
          },
          components: {
            Menu: {
              itemBorderRadius: 4
            }
          }
        }}
      >
        <App />
      </ConfigProvider>
    </StyleProvider>
  </BrowserRouter>
)
